package com.cxx.purchasecharge.core.model.persistence.auditlog;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.cxx.purchasecharge.core.model.BaseModel;

/**
 * 操作日志从表
 * 
 * @author xiang
 * 
 */
@Entity
@Table (name = "pc_log_content")
public class LogContent extends BaseModel
{
    private static final long serialVersionUID = 1L;

    private long id;
    private Log log;
    private String field;
    private String oldValue;
    private String newValue;
    private String comment;

    @Id
    @GeneratedValue (strategy = GenerationType.AUTO)
    public long getId ()
    {
        return id;
    }

    public void setId (long id)
    {
        this.id = id;
    }

    @ManyToOne (optional = false)
    @JoinColumn (name = "log_id")
    public Log getLog ()
    {
        return log;
    }

    public void setLog (Log log)
    {
        this.log = log;
    }

    @Column (nullable = false)
    public String getField ()
    {
        return field;
    }

    public void setField (String field)
    {
        this.field = field;
    }

    public String getOldValue ()
    {
        return oldValue;
    }

    public void setOldValue (String oldValue)
    {
        this.oldValue = oldValue;
    }

    public String getNewValue ()
    {
        return newValue;
    }

    public void setNewValue (String newValue)
    {
        this.newValue = newValue;
    }

    public String getComment ()
    {
        return this.comment;
    }

    public void setComment (String comment)
    {
        this.comment = comment;
    }
}
